<template>
	<view class="s_wp">
		<view class="p_logo">
			<image src="/static/logo.png" ></image>
			<text>多米街商城</text>
		</view>
		<view class="nav_bar">
			<!-- <image src="/static/fanhui.png" class="back" mode="widthFix" @click="back()"></image> -->
			<view class="search" @click="$navTo('/pages/searchgoodlist/searchgoodlist')">
				<text class="yticon icon-sousuo" :style="{color:bg}"></text>
				<text class="text">搜索大牌商品</text>
			</view>
			<!-- <view class="order" style="margin: 0 20upx;" @click="$navTo('/pages/taobao/taobaoCustomer')" >
				<image style="width: 40upx;height: 40upx;" src="/static/taobao/sheng.png" ></image>
				<view style="font-size: 20rpx;">省钱</view>
			</view> -->
			<view class="order" style="margin:0 20upx;" @click="$navTo('/pages/category/category')" >
				<image style="width: 40upx;height: 40upx;" src="/static/fenlei.png" ></image>
				<view style="font-size: 20rpx;">分类</view>
			</view>
			<view class="order" @click="navOrder" >
				<image style="width: 40upx;height: 40upx;" src="/static/dingdan.png" ></image>
				<view style="font-size: 20rpx;">订单</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'tab_search',
		props: {
			bg: {
				type: String,
				default: ''
			}
		},
		methods: {
			fenlei(url){
				uni.navigateTo({
					url: url
				})
			},
			navOrder() {
				uni.setStorageSync('upOrderType', 1);
				this.$navTo('/pages/index/order');
			},
			back(){
				uni.navigateBack();
			},
			kefu() {
				this.$axios('home/kf', 'POST', 'shop').then(res => {
					if (res.data.code == 200) {
						var href = res.data.data;
						// #ifdef APP-PLUS || MP-WEIXIN || MP-ALIPAY
						uni.navigateTo({
							url: "../web/web-view?url=" + href
						})
						// #endif
						// #ifdef H5
						window.location.href = href
						// #endif
					} else {}
				}), (error) => {}

			},
		}
	}
</script>

<style lang="scss">
	@font-face {
		font-family: iconfont;
		font-weight: normal;
		font-style: normal;
		src: url('../../static/iconfont.ttf') format('truetype');
	}

	.iconfont {
		font-family: "iconfont" !important;
		font-size: 16px;
		font-style: normal;
		-webkit-font-smoothing: antialiased;
		-moz-osx-font-smoothing: grayscale;
	}

	.icon-kefu:before {
		content: "\e769";
	}
	.s_wp {
		background: linear-gradient($bg-color,#7404cd);
		color: #fff;
		height: calc(var(--status-bar-height) + 210rpx);
		padding: calc(var(--status-bar-height) + 38rpx) 10rpx 20rpx;
		position: fixed;
		left: 0;
		top: 0;
		width: 100%;
		z-index: 999;
	
		.p_logo {
			display: flex;
			align-items: center;
			font-size: 34rpx;
	
			image {
				height: 74rpx;
				width: 74rpx;
				margin: 0 20rpx;
			}
		}
	
		.nav_bar {
			display: flex;
			align-items: center;
			padding: 10rpx 20rpx 6rpx 5rpx;
			.back{
				width: 30rpx;
				margin-right: 13rpx;
			}
			.search {
				background: #fff;
				border-radius: 80rpx;
				color: #303133;
				flex: 1;
				padding: 0 20rpx 0 50rpx;
				position: relative;
				height: 60rpx;
				line-height: 60rpx;
	
				.icon-sousuo {
					color: $font-color-dark;
					position: absolute;
					top: 50%;
					transform: translateY(-50%);
					left: 8rpx;
				}
			}
			.order {
				image {
					height: 60rpx;
					width: 60rpx;
				}
			}
		}
	}
	
	
</style>